package top.malaoshi.controller;

import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;
import top.malaoshi.client.NoticeClient;
import top.malaoshi.entity.Notice;
import top.malaoshi.model.JsonResult;

import javax.annotation.Resource;

@RestController
public class FollowController {


    @Resource
    private NoticeClient client;

    @PostMapping(value="/follow")
    public JsonResult follow(Notice notice){
        //推送消息，是调用另一个微服务
        return client.follow(notice);
    }

    @GetMapping(value="/getNotice/{id}")
    public JsonResult getNotice(@PathVariable("id") String id){

        return client.getNotice(id);
    }


}
